﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TaskScheduler;

namespace TaskSchedulerTest
{
    class Program
    {
        static void Main(string[] args)
        {
            SimpleTrigger simpleTrigger = new SimpleTrigger(2, 3);
            CronTrigger cronTrigger = new CronTrigger("0/5 * * ? * MON-FRI");

            Scheduler scheduler = new Scheduler();
            scheduler.AddJob(cronTrigger, (trigger) =>
            {
                Console.WriteLine("cronTrigger触发，工作日每隔5秒");
            });

            scheduler.AddJob(simpleTrigger, (trigger) =>
            {
                Console.WriteLine("simpleTrigger触发，每隔两秒，一共执行3次");
            });

            scheduler.Start();
            Console.ReadLine();
        }
    }
}
